<template>
  <el-dialog v-model="visible" modal-class="procure-receive-dialog" width="500" align-center center :show-close="false">
    <template #header>
      <p style="text-align: left"><i class="icon"></i>确认接单</p>
    </template>

    <div class="content-wrap">
      <h1 class="f18 mt10 mb10">
        当前订单生产周期为：<span>{{ cycleTime }}天</span>
      </h1>
      <i class="red-text f12" v-if="redText">{{ redText }}</i>
      <div class="gray-block pd20 mt8">
        <p class="f16 mb6">预计发货日期为：{{ sendTime }}</p>
        <span class="f12">{{ message }}</span>
      </div>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <div class="mt20">
          <el-button class="jzt-button" type="info" @click="visible = false" style="width: 120px">取消</el-button>
          <el-button type="primary" @click="submit" style="width: 120px">{{ submitBtnText }}</el-button>
        </div>
      </div>
    </template>
  </el-dialog>
</template>

<script setup>
import { computed, ref } from "vue";

const props = defineProps({
  type: {
    type: String,
    default: "error"
  },
  submitBtnText: {
    type: String,
    default: "确认返还"
  },
  isOpen: {
    type: Boolean,
    default: false
  },
  cycleTime: {
    type: Number,
    default: 0 //生产周期
  },
  redText: {
    type: String,
    default: "" //温馨提示：注意采购商修改了周期，原定日期为40天，预计2024-10-24日前
  },
  sendTime: {
    type: String,
    default: "--" //预计发货日期
  },
  message: {
    type: String,
    default: "---"
  }
});
const emit = defineEmits(["update:isOpen", "submit"]);
const visible = computed({
  get() {
    return props.isOpen;
  },
  set(value) {
    emit("update:isOpen", value);
  }
});

const submit = () => {
  emit("submit");
};
</script>

<style scoped lang="scss">
.content-wrap {
  h1 {
    text-align: center;
  }
  .red-text {
    color: #ff3333;
    font-style: normal;
    display: block;
    text-align: center;
  }
  .gray-block {
    background-color: #f5f7fa;
    color: #3d3d3d;
    span {
      color: #86909c;
      line-height: 20px;
    }
  }
}

.title {
  color: #3d3d3d;
  font-size: 20px;
  margin-bottom: 32px;
}
.sure {
  text-align: center;
  span {
    font-size: 14px;
    color: #3d3d3d;
    line-height: 20px;
  }

  ::v-deep(.el-icon) {
    font-size: 60px;
    margin-bottom: 20px;
    color: rgb(255, 51, 51);
  }
}
.audit-dialog {
  .goods-detail {
    margin-bottom: 20px;
  }
}

.alert {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 54px;
  margin: 0 0 10px;
  background: #ffd9c2;
  border-radius: 6px;

  .el-icon {
    color: #e37318;
    margin: 0 10px;
  }
}

.dialog-footer-flex {
  display: flex;
  justify-content: space-between;
}
</style>
